package equals方法比较内容是否相同;

public class Test {
    public static void main(String[] args) {
        Person person1 = new Person("zhangsan",10);
        System.out.println(person1);
        Person person2 = new Person("zhangsan",10);
        System.out.println(person2);
        //此时比较的是地址
        System.out.println(person1 == person2); // false
        System.out.println(person1.equals(person2));  //看看person1是否与person2内容一样
    }
}
